// 学生查询

import axios from "axios";

export default function (page, size, type, collegeId, majorId, classId, gradeId, keyword) {
    let params = {
        collegeId, majorId, gradeId, classId,  page, size, type, keyword,
    }
    return axios({
        method: "get",
        url: "/api/cAdmin/students",
        params,
        header: {
            Authorization: localStorage.getItem("Authorization")
        }
    }).then(response => {
        for (let i = 0; i < response.data.students.length; i++) {
            response.data.students[i].key = i;
        }
        return {
            result: true,
            total: response.data.total,
            students: response.data.students
        }
    }).catch(error => {
        return {
            result: false,
            msg: error.response.data.msg
        }
    })
}